<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>unpacked_array - ClueLib</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="unpacked_array"></a>unpacked_array</h1><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual class unpacked_array #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> bit,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>SIZE</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>A parameterized class that manages an unpacked array.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>T</td><td class=CDLDescription><span class="optional">optional</span> The type of an unpacked array.&nbsp; The default type is <b>bit</b>.</td></tr><tr><td class=CDLEntry>SIZE</td><td class=CDLDescription><span class="optional">optional</span> The size of an unpacked array.&nbsp; The default is 1.</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#unpacked_array" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">unpacked_array</a></td><td class=SDescription>A parameterized class that manages an unpacked array.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#unpacked_array.Common_Arguments" >Common Arguments</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#unpacked_array.Types" >Types</a></td><td class=SDescription></td></tr><tr class="SType SIndent2 SMarked"><td class=SEntry><a href="#unpacked_array.ua_type" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">ua_type</a></td><td class=SDescription>The shorthand of the unpacked array type of type <b>T</b>.</td></tr><tr class="SType SIndent2"><td class=SEntry><a href="#unpacked_array.da_type" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">da_type</a></td><td class=SDescription>The shorthand of the dynamic array type of type <b>T</b>.</td></tr><tr class="SType SIndent2 SMarked"><td class=SEntry><a href="#unpacked_array.q_type" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">q_type</a></td><td class=SDescription>The shorthand of the queue type of type <b>T</b>.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#unpacked_array.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#unpacked_array.from_dynamic_array" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">from_dynamic_array</a></td><td class=SDescription><span class="static">static</span> Converts a dynamic array of type <b>T</b> to un unpacked array of the same type. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#unpacked_array.to_dynamic_array" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">to_dynamic_array</a></td><td class=SDescription><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a dynamic array of the same type.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#unpacked_array.from_queue" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">from_queue</a></td><td class=SDescription><span class="static">static</span> Converts a queue of type <b>T</b> to an unpacked array of the same type. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#unpacked_array.to_queue" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">to_queue</a></td><td class=SDescription><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a queue of the same type.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#unpacked_array.da_to_ua" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">da_to_ua</a></td><td class=SDescription><span class="static">static</span> Converts a dynamic array of type <b>T</b> to an unpacked array of the same type. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#unpacked_array.ua_to_da" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">ua_to_da</a></td><td class=SDescription><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a dynamic array of the same type. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#unpacked_array.q_to_ua" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">q_to_ua</a></td><td class=SDescription><span class="static">static</span> Converts a queue of type <b>T</b> to an unpacked array of the same type. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#unpacked_array.ua_to_q" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">ua_to_q</a></td><td class=SDescription><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a queue of the same type. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#unpacked_array.init" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">init</a></td><td class=SDescription><span class="static">static</span> Initializes the each element of the given unpacked array to the specified value.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#unpacked_array.reverse" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">reverse</a></td><td class=SDescription><span class="static">static</span> Reverses the order of the elements of the given unpacked array.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#unpacked_array.compare" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">compare</a></td><td class=SDescription><span class="static">static</span> Compares two unpacked arrays.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#unpacked_array.to_string" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">to_string</a></td><td class=SDescription><span class="static">static</span> Converts an unpacked array to the form of a string.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.Common_Arguments"></a>Common Arguments</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>from_index</td><td class=CDLDescription>The index of the first element of an unpacked array to be processed.&nbsp;  If negative, the index counts from the last.&nbsp; For example, if <b>from_index</b> is -9, a function starts at the ninth element (inclusive) from the last.&nbsp;  The default is 0 (starts at the first element).</td></tr><tr><td class=CDLEntry>to_index</td><td class=CDLDescription>The index of the last element of an unpacked array to be processed.&nbsp;  If negative, the index counts from the last.&nbsp;  For example, if <b>to_index</b> is -3, a function ends at the third element (inclusive) from the last.&nbsp;  The default is -1 (ends at the last element).</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.Types"></a>Types</h3></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.ua_type"></a>ua_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T ua_type[SIZE]</td></tr></table></blockquote><p>The shorthand of the unpacked array type of type <b>T</b>.</p></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.da_type"></a>da_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T da_type[]</td></tr></table></blockquote><p>The shorthand of the dynamic array type of type <b>T</b>.</p></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.q_type"></a>q_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T q_type[$]</td></tr></table></blockquote><p>The shorthand of the queue type of type <b>T</b>.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.from_dynamic_array"></a>from_dynamic_array</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ua_type from_dynamic_array(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>da_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>da,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts a dynamic array of type <b>T</b> to un unpacked array of the same type.&nbsp;  If the size of the dynamic array is larger than <b>SIZE</b>, the excess elements are ignored.&nbsp; If the size of the dynamic array is smaller than <b>SIZE</b>, the default value of type <b>T</b> is used for the missing elements.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>da</td><td class=CDLDescription>A dynamic array to be converted.</td></tr><tr><td class=CDLEntry>reverse</td><td class=CDLDescription><span class="optional">optional</span> If 0, the element at the index 0 of <b>da</b> is positioned to the index 0 of the unpacked array.&nbsp; If 1, the elements are positioned in the reverse order.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>An unpacked array converted from <b>da</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit da[] = new[8]( '{ 0, 0, 0, 1, 1, 0, 1, 1 } ); // da[0] to da[7]
bit ua0[8] =       '{ 0, 0, 0, 1, 1, 0, 1, 1 };
bit ua1[8] =       '{ 1, 1, 0, 1, 1, 0, 0, 0 };

assert( unpacked_array#(bit,8)::from_dynamic_array( da                ) == ua0 );
assert( unpacked_array#(bit,8)::from_dynamic_array( da, .reverse( 1 ) ) == ua1 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#unpacked_array.da_to_ua" class=LFunction id=link17 onMouseOver="ShowTip(event, 'tt9', 'link17')" onMouseOut="HideTip('tt9')">da_to_ua</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.to_dynamic_array"></a>to_dynamic_array</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function da_type to_dynamic_array(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a dynamic array of the same type.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ua</td><td class=CDLDescription>A unpacked array to be converted.</td></tr><tr><td class=CDLEntry>reverse</td><td class=CDLDescription><span class="optional">optional</span> If 0, the element at the index 0 of <b>ua</b> is positioned to the index 0 of the dynamic array.&nbsp; If 1, the elements are positioned in the reverse order.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A dynamic array converted from <b>ua</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit ua[8] =         '{ 0, 0, 0, 1, 1, 0, 1, 1 }; // assigned to ua[0:7]
bit da0[] = new[8]( '{ 0, 0, 0, 1, 1, 0, 1, 1 } );
bit da1[] = new[8]( '{ 1, 1, 0, 1, 1, 0, 0, 0 } );

assert( unpacked_array#(bit,8)::to_dynamic_array( ua                ) == da0 );
assert( unpacked_array#(bit,8)::to_dynamic_array( ua, .reverse( 1 ) ) == da1 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#unpacked_array.ua_to_da" class=LFunction id=link18 onMouseOver="ShowTip(event, 'tt10', 'link18')" onMouseOut="HideTip('tt10')">ua_to_da</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.from_queue"></a>from_queue</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ua_type from_queue(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>q_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>q,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts a queue of type <b>T</b> to an unpacked array of the same type.&nbsp;  If the size of the queue is larger than <b>SIZE</b>, the excess elements are ignored.&nbsp; If the size of the queue is smaller than <b>SIZE</b>, the default valus of type <b>T</b> is used for the missing elements.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>q</td><td class=CDLDescription>A queue to be converted.</td></tr><tr><td class=CDLEntry>reverse</td><td class=CDLDescription><span class="optional">optional</span> If 0, the element at the index 0 of <b>q</b> is positioned to the index 0 of the unpacked array.&nbsp; If 1, the elements are positioned in the reverse order.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>An unpacked array converted from <b>q</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit q[$]   =  { 0, 0, 0, 1, 1, 0, 1, 1 }; // q[0] to q[7]
bit ua0[8] = '{ 0, 0, 0, 1, 1, 0, 1, 1 };
bit ua1[8] = '{ 1, 1, 0, 1, 1, 0, 0, 0 };

assert( unpacked_array#(bit,8)::from_queue( q                ) == ua0 );
assert( unpacked_array#(bit,8)::from_queue( q, .reverse( 1 ) ) == ua1 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#unpacked_array.q_to_ua" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt11', 'link19')" onMouseOut="HideTip('tt11')">q_to_ua</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.to_queue"></a>to_queue</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function q_type to_queue(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a queue of the same type.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ua</td><td class=CDLDescription>An unpacked array to be converted.</td></tr><tr><td class=CDLEntry>reverse</td><td class=CDLDescription><span class="optional">optional</span> If 0, the element at the index 0 of <b>ua</b> is positioned to the index 0 of the queue.&nbsp; If 1, the elements are positioned in the reverse order.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A queue converted from <b>ua</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit ua[8] = '{ 0, 0, 0, 1, 1, 0, 1, 1 }; // assigned to ua[0:7]
bit q0[$] =  { 0, 0, 0, 1, 1, 0, 1, 1 };
bit q1[$] =  { 1, 1, 0, 1, 1, 0, 0, 0 };

assert( unpacked_array#(bit,8)::to_queue( ua                ) == q0 );
assert( unpacked_array#(bit,8)::to_queue( ua, .reverse( 1 ) ) == q1 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#unpacked_array.ua_to_q" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt12', 'link20')" onMouseOut="HideTip('tt12')">ua_to_q</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.da_to_ua"></a>da_to_ua</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void da_to_ua(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>da_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>da,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts a dynamic array of type <b>T</b> to an unpacked array of the same type.&nbsp;  Unlike <a href="#unpacked_array.from_dynamic_array" class=LFunction id=link21 onMouseOver="ShowTip(event, 'tt5', 'link21')" onMouseOut="HideTip('tt5')">from_dynamic_array</a>, this function populates the unpacked array passed by reference, instead of returning a new unpacked array.&nbsp; If the size of the dynamic array is larger than <b>SIZE</b>, the excess elements are ignored.&nbsp; If the size of the dynamic array is smaller than <b>SIZE</b>, the default value of type <b>T</b> is used for the missing elements.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>da</td><td class=CDLDescription>A dynamic array to be converted.</td></tr><tr><td class=CDLEntry>ua</td><td class=CDLDescription>An unpacked array to be populated.</td></tr><tr><td class=CDLEntry>reverse</td><td class=CDLDescription><span class="optional">optional</span> If 0, the element at the index 0 of <b>da</b> is positioned to the index 0 of <b>ua</b>.&nbsp; If 1, the elements are positioned in the reverse order.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit da[] = new[8]( '{ 0, 0, 0, 1, 1, 0, 1, 1 } ); // da[0] to da[7]
bit ua[8];
bit ua0[8] = '{ 0, 0, 0, 1, 1, 0, 1, 1 };
bit ua1[8] = '{ 1, 1, 0, 1, 1, 0, 0, 0 };

unpacked_array#(bit,8)::da_to_ua( da, ua );
assert( ua == ua0 );

unpacked_array#(bit,8)::da_to_ua( da, ua, .reverse( 1 ) );
assert( ua == ua1 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#unpacked_array.from_dynamic_array" class=LFunction id=link22 onMouseOver="ShowTip(event, 'tt5', 'link22')" onMouseOut="HideTip('tt5')">from_dynamic_array</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.ua_to_da"></a>ua_to_da</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void ua_to_da(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>da_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>da,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a dynamic array of the same type.&nbsp; Unlike <a href="#unpacked_array.to_dynamic_array" class=LFunction id=link23 onMouseOver="ShowTip(event, 'tt6', 'link23')" onMouseOut="HideTip('tt6')">to_dynamic_array</a>, this function populates the dynamic array passed by reference, instead of returning a new dynamic array.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ua</td><td class=CDLDescription>An unpacked array to be converted.</td></tr><tr><td class=CDLEntry>da</td><td class=CDLDescription>A dynamic array to be populated.&nbsp; This function does <u>not</u> resize <b>da</b>.&nbsp; Make sure to set the size of the dynamic array to accommodate the elements of <b>ua</b> before calling this function.</td></tr><tr><td class=CDLEntry>reverse</td><td class=CDLDescription><span class="optional">optional</span> If 0, the element at the index 0 of <b>ua</b> is positioned to the index 0 of <b>da</b>.&nbsp; If 1, the elements are positioned in the reverse order.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit ua[8] = '{ 0, 0, 0, 1, 1, 0, 1, 1 }; // assigned to ua[0:7]
bit da [] = new[8]; // set the size of da[]
bit da0[] = new[8]( '{ 0, 0, 0, 1, 1, 0, 1, 1 } );
bit da1[] = new[8]( '{ 1, 1, 0, 1, 1, 0, 0, 0 } );

unpacked_array#(bit,8)::ua_to_da( ua, da );
assert( da == da0 );

unpacked_array#(bit,8)::ua_to_da( ua, da, .reverse( 1 ) );
assert( da == da1 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#unpacked_array.to_dynamic_array" class=LFunction id=link24 onMouseOver="ShowTip(event, 'tt6', 'link24')" onMouseOut="HideTip('tt6')">to_dynamic_array</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.q_to_ua"></a>q_to_ua</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void q_to_ua(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>q_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>q,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts a queue of type <b>T</b> to an unpacked array of the same type.&nbsp;  Unlike <a href="#unpacked_array.from_queue" class=LFunction id=link25 onMouseOver="ShowTip(event, 'tt7', 'link25')" onMouseOut="HideTip('tt7')">from_queue</a>, this function populates the unpacked array passed by reference, instead of returning a new unpacked array.&nbsp; If the size of the queue is larger than <b>SIZE</b>, the excess elements are ignored.&nbsp; If the size of the queue is smaller than <b>SIZE</b>, the default valus of type <b>T</b> is used for the missing elements.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>q</td><td class=CDLDescription>A queue to be converted.</td></tr><tr><td class=CDLEntry>ua</td><td class=CDLDescription>An unpacked array to be populated.</td></tr><tr><td class=CDLEntry>reverse</td><td class=CDLDescription><span class="optional">optional</span> If 0, the element at the index 0 of <b>q</b> is positioned to the index 0 of <b>ua</b>.&nbsp; If 1, the elements are positioned in the reverse order.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit q[$] = { 0, 0, 0, 1, 1, 0, 1, 1 }; // q[0] to q[7]
bit ua [8];
bit ua0[8] = '{ 0, 0, 0, 1, 1, 0, 1, 1 };
bit ua1[8] = '{ 1, 1, 0, 1, 1, 0, 0, 0 };

unpacked_array#(bit,8)::q_to_ua( q, ua );
assert( ua == ua0 );

unpacked_array#(bit,8)::q_to_ua( q, ua, .reverse( 1 ) );
assert( ua == ua1 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#unpacked_array.from_queue" class=LFunction id=link26 onMouseOver="ShowTip(event, 'tt7', 'link26')" onMouseOut="HideTip('tt7')">from_queue</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.ua_to_q"></a>ua_to_q</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void ua_to_q(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>q_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>q,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a queue of the same type.&nbsp; Unlike <a href="#unpacked_array.to_queue" class=LFunction id=link27 onMouseOver="ShowTip(event, 'tt8', 'link27')" onMouseOut="HideTip('tt8')">to_queue</a>, this function populates the queue passed by reference instead of returning a new queue.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ua</td><td class=CDLDescription>An unpacked array to be converted.</td></tr><tr><td class=CDLEntry>q</td><td class=CDLDescription>A queue to be populated.</td></tr><tr><td class=CDLEntry>reverse</td><td class=CDLDescription><span class="optional">optional</span> If 0, the element at the index 0 of <b>ua</b> is positioned to the index 0 of <b>q</b>.&nbsp; If 1, the elements are positioned in the reverse order.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit ua[8] = '{ 0, 0, 0, 1, 1, 0, 1, 1 }; // assigned to ua[0:7]
bit q [$];
bit q0[$] = { 0, 0, 0, 1, 1, 0, 1, 1 };
bit q1[$] = { 1, 1, 0, 1, 1, 0, 0, 0 };

unpacked_array#(bit,8)::ua_to_q( ua, q );
assert( q == q0 );

q.delete();
unpacked_array#(bit,8)::ua_to_q( ua, q, .reverse( 1 ) );
assert( q == q1 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#unpacked_array.to_queue" class=LFunction id=link28 onMouseOver="ShowTip(event, 'tt8', 'link28')" onMouseOut="HideTip('tt8')">to_queue</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.init"></a>init</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void init(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>val</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Initializes the each element of the given unpacked array to the specified value.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ua</td><td class=CDLDescription>An unpacked array to be initialized.</td></tr><tr><td class=CDLEntry>val</td><td class=CDLDescription>A value to initialize the elements of <b>ua</b>.</td></tr></table><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit ua[8];
bit expected[8] = '{ 1, 1, 1, 1, 1, 1, 1, 1 };

unpacked_array#(bit,8)::init( ua, 1'b1 );
assert( ua == expected );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.reverse"></a>reverse</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void reverse(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Reverses the order of the elements of the given unpacked array.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ua</td><td class=CDLDescription>An unpacked array to be reversed.</td></tr></table><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit ua[8] = '{ 0, 0, 0, 0, 1, 1, 1, 1 };
bit expected[8] = '{ 1, 1, 1, 1, 0, 0, 0, 0 };

unpacked_array#(bit,8)::reverse( ua );
assert( ua == expected );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.compare"></a>compare</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit compare(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua1,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua2,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_index1</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_index1</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_index2</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_index2</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>comparator#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>cmp</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Compares two unpacked arrays.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ua1</td><td class=CDLDescription>An unpacked array.</td></tr><tr><td class=CDLEntry>ua2</td><td class=CDLDescription>Another unpacked array to compare with <b>ua1</b>.</td></tr><tr><td class=CDLEntry>from_index1</td><td class=CDLDescription><span class="optional">optional</span> The index of the first element of <b>ua1</b> to compare.&nbsp; See <a href="#unpacked_array.Common_Arguments" class=LGroup >Common Arguments</a>.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>to_index1</td><td class=CDLDescription><span class="optional">optional</span> The index of the last element of <b>ua1</b> to compare.&nbsp; See <a href="#unpacked_array.Common_Arguments" class=LGroup >Common Arguments</a>.&nbsp; The default is -1.</td></tr><tr><td class=CDLEntry>from_index2</td><td class=CDLDescription><span class="optional">optional</span> The index of the first element of <b>ua2</b> to compare.&nbsp; See <a href="#unpacked_array.Common_Arguments" class=LGroup >Common Arguments</a>.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>to_index2</td><td class=CDLDescription><span class="optional">optional</span> The index of the last element of <b>ua2</b> to compare.&nbsp; See <a href="#unpacked_array.Common_Arguments" class=LGroup >Common Arguments</a>.&nbsp; The default is -1.</td></tr><tr><td class=CDLEntry>cmp</td><td class=CDLDescription><span class="optional">optional</span> A strategy object used to compare two unpacked arrays.&nbsp; If not specified or <b>null</b>, <a href="cl_comparator-svh.html#comparator" class=LClass id=link29 onMouseOver="ShowTip(event, 'tt17', 'link29')" onMouseOut="HideTip('tt17')">comparator</a> <b>#(T)</b> is used.&nbsp; The default is <b>null</b>.</td></tr></table><h4 class=CHeading>Returns</h4><p>If the numbers of elements to compare (<b>to_index1-from_index1+1</b> and <b>to_index2-from_index2+1</b>) are different, 0 is returned.&nbsp;  If the two unpacked arrays contain the same data in the specified range, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit ua1[8] = '{ 0, 0, 0, 1, 1, 0, 1, 1 };
bit ua2[8] = '{ 1, 1, 0, 1, 1, 0, 0, 0 };
//                    |&lt;------&gt;|
//                    2        5
assert( unpacked_array#(bit,8)::compare( ua1, ua2 ) == 0 );
assert( unpacked_array#(bit,8)::compare( ua1, ua2,
        .from_index1( 2 ), .to_index1( 5 ),
        .from_index2( 2 ), .to_index2( 5 ) ) == 1 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="unpacked_array.to_string"></a>to_string</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string to_string(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>separator</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>formatter#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>fmtr</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts an unpacked array to the form of a string.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ua</td><td class=CDLDescription>An unpacked array to be converted.</td></tr><tr><td class=CDLEntry>separator</td><td class=CDLDescription><span class="optional">optional</span> A string to separate each element of <b>ua</b>.&nbsp; The default is a space (&ldquo; &ldquo;).</td></tr><tr><td class=CDLEntry>from_index</td><td class=CDLDescription><span class="optional">optional</span> The index of the first element of <b>ua</b> to convert.&nbsp; See <a href="#unpacked_array.Common_Arguments" class=LGroup >Common Arguments</a>.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>to_index</td><td class=CDLDescription><span class="optional">optional</span> The index of the last element of <b>ua</b> to convert.&nbsp; See <a href="#unpacked_array.Common_Arguments" class=LGroup >Common Arguments</a>.&nbsp; The default is -1.</td></tr><tr><td class=CDLEntry>fmtr</td><td class=CDLDescription><span class="optional">optional</span> A strategy object used to format <b>ua</b>.&nbsp; If not specified or <b>null</b>, <a href="cl_hex_formatter-svh.html#hex_formatter" class=LClass id=link30 onMouseOver="ShowTip(event, 'tt18', 'link30')" onMouseOut="HideTip('tt18')">hex_formatter</a> <b>#(T)</b> is used.&nbsp; The default is <b>null</b>.</td></tr></table><h4 class=CHeading>Returns</h4><p>A string to represent <b>ua</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit ua[8] = '{ 0, 0, 0, 1, 1, 0, 1, 1 }; // assigned to ua[0:7]
assert( unpacked_array#(bit,8)::to_string( ua )                    == &quot;0 0 0 1 1 0 1 1&quot; );
assert( unpacked_array#(bit,8)::to_string( ua, .separator( &quot;-&quot; ) ) == &quot;0-0-0-1-1-0-1-1&quot; );
assert( unpacked_array#(bit,8)::to_string( ua, .from_index( 4 )  ) ==         &quot;1 0 1 1&quot; );</pre></blockquote></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual class unpacked_array #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> bit,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>SIZE</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A parameterized class that manages an unpacked array.</div></div><div class=CToolTip id="tt2"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T ua_type[SIZE]</td></tr></table></blockquote>The shorthand of the unpacked array type of type <b>T</b>.</div></div><div class=CToolTip id="tt3"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T da_type[]</td></tr></table></blockquote>The shorthand of the dynamic array type of type <b>T</b>.</div></div><div class=CToolTip id="tt4"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T q_type[$]</td></tr></table></blockquote>The shorthand of the queue type of type <b>T</b>.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ua_type from_dynamic_array(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>da_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>da,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts a dynamic array of type <b>T</b> to un unpacked array of the same type. </div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function da_type to_dynamic_array(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a dynamic array of the same type.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ua_type from_queue(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>q_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>q,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts a queue of type <b>T</b> to an unpacked array of the same type. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function q_type to_queue(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a queue of the same type.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void da_to_ua(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>da_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>da,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts a dynamic array of type <b>T</b> to an unpacked array of the same type. </div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void ua_to_da(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>da_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>da,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a dynamic array of the same type. </div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void q_to_ua(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>q_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>q,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts a queue of type <b>T</b> to an unpacked array of the same type. </div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void ua_to_q(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>q_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>q,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts an unpacked array of type <b>T</b> to a queue of the same type. </div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void init(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>val</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Initializes the each element of the given unpacked array to the specified value.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function void reverse(</td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Reverses the order of the elements of the given unpacked array.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit compare(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua1,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua2,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_index1</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_index1</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_index2</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_index2</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>comparator#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>cmp</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Compares two unpacked arrays.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string to_string(</td><td class="PTypePrefix  prettyprint " nowrap>const ref&nbsp;</td><td class="PType  prettyprint " nowrap>ua_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ua,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>separator</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>formatter#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>fmtr</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts an unpacked array to the form of a string.</div></div><div class=CToolTip id="tt17"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class comparator#(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="singleton">singleton</span> Provides strategies to compare objects.</div></div><div class=CToolTip id="tt18"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class hex_formatter #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends formatter#( T )</td></tr></table></td></tr></table></blockquote><span class="singleton">singleton</span> Provides a strategy to convert an object of type <b>T</b> to a string using a hexadecimal format.</div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>